function ReadLidarTxt, files
    
    
    ;temporary vars, according to file format
    t_year = 0 & t_month = 0 & t_day = 0 & t_hour = 0 & t_minute = 0 & t_second = 0
    t_laser_freq = 0.0D
    t_shot_num = 0.0D
    t_energy = 0.0D
    t_temp_detector = 0.0D & t_temp_box = 0.0D & t_temp_laser = 0.0D
    t_cloud_base_height = 0.0D
    t_background = 0.0D
    t_bintime = 0.0D
    t_maxheight = 0.0D
    t_dead_time_corrected = 0
    t_index = 0LL & t_binnum = 0L
   ; t_data = dblarr(size decided when read t_binnum)
    
    inited = 0 ; damn idl! why not support zero sized array?
;    year = 0 & month = 0 & day = 0 & hour = 0 & minute = 0 & second = 0
;    laser_freq = 0.0D
;    shot_num = 0.0D
;    energy = 0.0D
;    temp_detector = 0.0D & temp_box = 0.0D & temp_laser = 0.0D
;    cloud_base_height = 0.0D
;    background = 0.0D
;    bintime = 0.0D
;    maxheight = 0.0D
;    dead_time_corrected = 0
;    index = 0LL & binnum = 0L
;    data = dblarr(line_size)
    
    for i = 0, n_elements(files) - 1 do begin
        openr, lun, files[i], /get_lun
        while ~ eof(lun) do begin
            readf, lun, t_year, t_month, t_day, t_hour, t_minute, t_second
            readf, lun, t_laser_freq
            readf, lun, t_shot_num
            readf, lun, t_energy
            readf, lun, t_temp_detector, t_temp_box, t_temp_laser
            readf, lun, t_cloud_base_height
            readf, lun, t_background
            readf, lun, t_bintime
            readf, lun, t_maxheight
            readf, lun, t_dead_time_corrected
            readf, lun, t_index, t_binnum
			t_data = dblarr(t_binnum)
            readf, lun, t_data
            
            if( inited eq 0 ) then begin
                year = t_year & month = t_month & day = t_day & hour = t_hour & minute = t_minute & second = t_second
                laser_freq = t_laser_freq
                shot_num = t_shot_num
                energy = t_energy
                temp_detector = t_temp_detector & temp_box = t_temp_box & temp_laser = t_temp_laser
                cloud_base_height = t_cloud_base_height
                background = t_background
                bintime = t_bintime
                maxheight = t_maxheight
                dead_time_corrected = t_dead_time_corrected
                index = t_index & binnum = t_binnum
                data = t_data
                
                inited = 1 
            endif else begin
                year = [year, t_year] & month = [month, t_month] & day = [day, t_day] & hour = [hour,t_hour] & minute = [minute, t_minute] & second = [second, t_second]
                laser_freq = [laser_freq, t_laser_freq]
                shot_num = [shot_num, t_shot_num]
                energy = [energy, t_energy]
                temp_detector = [temp_detector, t_temp_detector] & temp_box = [temp_box, t_temp_box] & temp_laser = [temp_laser ,t_temp_laser]
                cloud_base_height = [cloud_base_height, t_cloud_base_height]
                background = [background, t_background]
                bintime = [bintime, t_bintime]
                maxheight = [maxheight, t_maxheight]
                dead_time_corrected = [dead_time_corrected, t_dead_time_corrected]
                index = [index, t_index] & binnum = [binnum, t_binnum]
                data = [[data], [t_data]]                
            endelse        
        endwhile
        free_lun, lun
    endfor
    
    if(n_elements(year) gt 0) then begin
        julian = julday(month, day, year, hour, minute, second)
		line_size = binnum[0]
    endif
    rec_num = n_elements(year)
    
    result = { $
        rec_num:rec_num, $
        line_size:line_size, $
        binsize:bintime[0] * 1.5e5, $ ; km
        julian:julian, $
        year:year, month:month, day:day, hour:hour, minute:minute, second:second, $
        laser_freq:laser_freq, $
        shot_num:shot_num, $
        energy:energy, $
        temp_detector:temp_detector, temp_box:temp_box, temp_laser:temp_laser, $
        cloud_base_height:cloud_base_height, $
        background:background, $
        bintime:bintime, $
        maxheight:maxheight, $
        dead_time_corrected:dead_time_corrected, $
        index:index, binnum:binnum, $
        data:transpose(data) $
        }
    
    return, result

end
